﻿<Page x:Class="SlideView.Sample.Pages.MainPage"
                            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                            xmlns:library="using:SlideView.Library"
                            mc:Ignorable="d">
    <Grid x:Name="LayoutRoot">
        <Grid x:Name="ContentPanel"
              Margin="12,0">

            <!-- Note the ListHeader, small tip to make room for the NavigationBar when on top --> 
            <ListView x:Name="LongList"
                      Background="Transparent">
                <ListView.Header>
                    <Grid Height="80"/>
                </ListView.Header>
                
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <Grid Margin="0,0,0,12">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition />
                            </Grid.ColumnDefinitions>

                            <Rectangle Fill="#10000000"
                                       Width="6"
                                       Margin="0,0,6,0" />

                            <TextBlock Text="{Binding}"
                                       FontSize="18"
                                       Foreground="DarkSlateGray"
                                       Grid.Column="1"
                                       TextWrapping="Wrap" />
                        </Grid>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>

            <!-- Declared after so it overlays the LongList, docked on top of the UI -->
            <library:AutoHideBar ScrollControl="{Binding ElementName=LongList}"
                                           Background="#F0F0F0"
                                           Margin="-12,0">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>

                    <ToggleButton IsChecked="True"
                                  Background="#A0A0A0"
                                  HorizontalAlignment="Stretch"
                                  Click="ToggleSlideEnabledButton_OnClick"
                                  FontSize="14"
                                  BorderThickness="0"
                                  Margin="12,0"
                                  Content="toggle slide interactions"
                                  Grid.Column="0" />

                    <Button BorderThickness="0"
                            HorizontalAlignment="Stretch"
                            Background="#A0A0A0"
                            Click="GoTopButton_OnClick"
                            Content="go top"
                            FontSize="14"
                            Margin="12,0"
                            Grid.Column="1" />

                </Grid>
            </library:AutoHideBar>
        </Grid>
        
    </Grid>

</Page>